<template>
  <div class="icon-display">
    <div class="icon-display__main">
      <t-icon :type="type" :kind="kind"></t-icon>
    </div>

    <span class="icon-class">{{ iconClass }}</span>
  </div>
</template>

<script lang="ts">
export default {
  props: {
    type: String,

    kind: String
  },

  computed: {
    iconClass() {
      return 'ri-' + this.type + (this.kind ? ('-' + this.kind) : '')
    }
  }
}
</script>

<style scoped>
.icon-display,
.icon-display__main {
  display: inline-flex;
  align-items: center;
}

.icon-display {
  flex-direction: column;
  padding: .25rem;
  will-change: contents;
}

.icon-display__main >>> .t-icon {
  font-size: 2rem;
}

.icon-class {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}
</style>